#base:
#  '*':


{% for app_env, app_list in salt['grains.get']('app', {}).items() %}
{% if app_env in ('local', 'dev', 'qa', 'ta', 'stage', 'live') %}
{{ app_env }}:
  'app:{{ app_env }}':
    - match: grain

    - vim.vimrc-tabsize

    {% for app_name in app_list %}
    # App level states
    - app.{{ app_name }}

    # Environment level states
    - app.{{ app_name }}.{{ app_env }}
    {% endfor %}

    # If jenkins master is specified, create slave node
    {% if salt['grains.get']('jenkins:master') %}
    - jenkins.slave
    {% endif %}
{% endif %}
{% endfor %}
